int main() {
	int n = 123456;
	int d = n % 10, m = n / 10;
	char s[300];
	sprintf(s, "%d%d", d, m);
	int y;
	sscanf(s, "%d", &y);
	printf("%d\n", y);
	return 0;
}
